package com.fandou.airobot.ui.alarm

import android.app.Activity
import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.blankj.utilcode.util.BarUtils
import com.blankj.utilcode.util.FragmentUtils


/**
 * @author Jm
 * @date 2020/6/24 12:00
 * @description 闹钟activity
 */
class AlarmActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        BarUtils.transparentStatusBar(this)
        BarUtils.setStatusBarLightMode(this, true)
        FragmentUtils.add(supportFragmentManager, AlarmListFragment.newInstance(), android.R.id.content, false, false)
    }

    override fun finish() {
        super.finish()
        overridePendingTransition(0, 0)
    }

    companion object {
        @JvmStatic
        fun start(context: Context) {
            val intent = Intent(context, AlarmActivity::class.java)
            context.startActivity(intent)
            (context as Activity).overridePendingTransition(0, 0)
        }
    }
}